<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Webshop - Din kundvagn</title>
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>css/style.css" />
</head>

<body>
<?php $this->load->view( 'cartbar', $cartTotal ); ?>
<div id="wrapper">
<div class="productFull">
<?php
    $html = '';
	$html .= '<p>' . anchor( 'index/index', '&laquo; Fortsätta shoppa' ) . '</p>';
	$html .= form_open( 'cart/Update');
    $html .= '<table cellpadding="6" cellspacing="4" border="0">';
	    $html .= '<tr>';
		    $html .= '<th>Antal</th>';
			$html .= '<th>Namn</th>';
			$html .= '<th>Pris</th>';
			$html .= '<th>Sub-total</th>';
		$html .= '</tr>';
		
		$i = 1;
	foreach( $this->cart->contents() as $items ) {
	    $html .= form_hidden( $i.'[rowid]', $items['rowid']);
		
		$html .= '<tr>';
		    $html .= '<td>' . form_input( array ( 'name' => $i.'[qty]', 'value' => $items['qty'], 'maxlength' => '3', 'size' => '5' ) ) . '</td>';
		    $html .= '<td>';
		    $html .= $items['name'];
		    $html .= '</td>';
		    $html .= '<td>' . $this->cart->format_number( $items['price'] ) . '</td>';
		    $html .= '<td>' . $this->cart->format_number( $items['subtotal'] ) . '</td>';
		$html .= '</tr>';
		
		$i++;
	}
	
	$html .= '<tr>';
	$html .= '<td colspan="2"> </td>';
	$html .= '<td><strong>Total</strong></td>';
	$html .= '<td>'. $this->cart->format_number( $this->cart->total() ) .'</td>';
	$html .= '</table>';
	$html .= form_submit('cart/update', 'Uppdatera kundvagn');
	$html .= form_close();
	
	$html .= form_open( 'cart/Clear');
	$html .= form_submit('cart/Clear', 'Betala' );
	$html .= form_close();
	echo $html;
?>
</div>
</div>
</body>
</html>
